package cn.wolfcode.luowowo.common.query;

import lombok.Getter;
import lombok.Setter;

import java.io.Serializable;

@Setter
@Getter
public class QueryObject implements Serializable {
        private int currentPage = 1;
        private int pageSize = 9;

    private String keyword;

    public String getKeyword() {
        return keyword != null ? keyword : null;
    }

    public int getStart() {
        return (this.currentPage - 1) * this.pageSize;
    }

    public int getPageSize() {
        return pageSize <= 0 ? Integer.MAX_VALUE : pageSize;
    }
}
